function sub(){
    var tvmid = $("#tvmid").val();

    if (tvmid == '') {
        $("#txt").html("tvmid不能空");
        return
    }
    $("#txt").html("");
    $.ajax({
        type: "GET",
        url:'/lost/checkBid?tvmid=' + tvmid,
        dataType:'json',
        success: function(ret){
            if(ret.code == 0){
                var b = ret.msg
                var j = ret.data
                extra = j.extra
                total = j.total
                var html=""
                var html2=""
                // html = 
                html += '</thead>';
                html += '<tbody>';

                html += '<tr>';
                    html += '<td style="width:100px">冻结金额 :';
                    html += '</td>';
                    html += '<td style="width:100px">' + extra;
                    html += '</td>';
                html += '</tr>';
                html += '<tr>';
                    html += '<td style="width:100px">实际金额 :';
                    html += '</td>';
                    html += '<td style="width:100px">' + total;
                    html += '</td>';
                html += '</tr>';

                html += '</tbody>';
                $("#tabel").append(html);

                html2 += '</thead>';
                html2 += '<tbody>';

                html2 += '<tr>';
                    html2 += '<td style="width:300px">' + b;
                    html2 += '</td>';
                html2 += '</tr>';

                html2 += '</tbody>';
                $("#bid").append(html2);

                $("#fir").hide()
                $("#se").show()
                $("#addtvmid").val(tvmid);
            }else{
                alert(ret.msg)
            }
        }
    });
}

function add(){
    var addtvmid = $("#addtvmid").val();
    var cardid = $("#cardid").val();
    var value = $("#value").val();

    if (addtvmid == '') {
        $("#txt2").html("用户tvmid不能空");
        return
    }
    $("#txt2").html("");
    if (cardid == '') {
        $("#txt2").html("道具id不能空");
        return
    }
    $("#txt2").html("");
    if (value == '') {
        $("#txt2").html("添加数量不能空");
        return
    }
    $("#txt2").html("");
    $.ajax({
        type: "GET",
        url:'/lost/editCard?tvmid=' + addtvmid + '&type=' + cardid + '&value=' + value,
        dataType:'json',
        success: function(ret){
            alert(ret.msg)
            if(ret.code == 0){
                window.location.reload()
            }   
        }
    });
}